<form action="/project/123/add_project" method="post" accept-charset="utf-8" class="add-project-form">
	<div class="str-setting box-skin">
		<div class="wrap-title">
			<h1>Add new project</h1>
		</div>
		<div class="wrap-project">
			<label>
 						<strong>Project name:</strong>
 						<input type="text" value="" name="name">
 					</label>
 					<label>
 						<strong>Description :</strong>
 						<textarea name="description"></textarea>
 					</label>
 					<div id="project-prop">
	 					<label class="quarter">
			 				<strong>Type :</strong>
	 						<input type="text" value="" name="type_name" class="type small topic">
	 						<input type="hidden" name="type" class="type_id js" value="">
			 			</label>
			 			
	 					<label class="quarter">
	 						<strong>Deadline :</strong>
	 						<input type="text" value="" name="deadline" class="deadline small">
	 					</label>
	 					<label class="quarter">
	 						<strong>Priority :</strong>
	 						<select name="priority">
	 							<option value="<?php echo Helper_MyConst::PRIORITY_LOW?>">Low</option>
	 							<option value="<?php echo Helper_MyConst::PRIORITY_MEDIUM?>">Medium</option>
	 							<option value="<?php echo Helper_MyConst::PRIORITY_HIGH?>">High</option>
	 						</select>
	 					</label>
 					</div>
 					<label class="save">
 						<button class="save" onclick="" name="save">Save</button>
	 						<a href="#" class="cancel">Cancel	</a>
 				</label>
 				
		</div>
	</div>
</form>

<script type="text/javascript">
	$(document).ready(function(){
		$('input#deadline').datepicker({
			showOn: "button",
			changeMonth : true,
			dateFormat: 'yy-mm-dd',
			timeFormat: 'hh-mm-ss'
		});
		$( ".type" ).autocomplete({
			source: '/ajax_project/get_suggest_type'
		});
		$( ".type" ).bind( "autocompleteselect", function(event, ui) {
			var hidden_input = $(this).parent().find('input.type_id.js');
			console.log(hidden_input);
			hidden_input.val(ui.item.id);
		});
	});
</script>

